Represents a particular manner of splitting an orderable data source into multiple partitions.
Namespace:
System.Collections.Concurrent
Assembly:
System.Threading (in System.Threading.dll)
Syntax
Visual Basic (Declaration) |
---|
<HostProtectionAttribute(SecurityAction.LinkDemand, Synchronization := True, _ ExternalThreading := True)> _ Public MustInherit Class OrderablePartitioner(Of TSource) _ Inherits Partitioner(Of TSource) |
C# |
---|
[HostProtectionAttribute(SecurityAction.LinkDemand, Synchronization = true, ExternalThreading = true)] public abstract class OrderablePartitioner<TSource> : Partitioner<TSource> |
Type Parameters
- TSource
- Type of the elements in the collection.
Remarks
Each element in each partition has an integer index associated with it, which determines the relative order of that element against elements in other partitions.
Inheritors of OrderablePartitioner<(Of <(TSource>)>) must adhere to the following rules:
- All indices must be unique, such that there may not be duplicate indices. If all indices are not unique, the output ordering may be scrambled.
- All indices must be non-negative. If any indices are negative, consumers of the implementation may throw exceptions.
- GetPartitions(Int32) and GetOrderablePartitions(Int32) should throw a ArgumentOutOfRangeException if the requested partition count is less than or equal to zero.
- GetPartitions(Int32) and GetOrderablePartitions(Int32) should always return a number of enumerables equal to the requested partition count. If the partitioner runs out of data and cannot create as many partitions as requested, an empty enumerator should be returned for each of the remaining partitions. If this rule is not followed, consumers of the implementation may throw a InvalidOperationException.
- GetPartitions(Int32), GetOrderablePartitions(Int32), GetDynamicPartitions()()(), and GetOrderableDynamicPartitions()()() should never return null. If null is returned, a consumer of the implementation may throw a InvalidOperationException.
- GetPartitions(Int32), GetOrderablePartitions(Int32), GetDynamicPartitions()()(), and GetOrderableDynamicPartitions()()() should always return partitions that can fully and uniquely enumerate the input data source. All of the data and only the data contained in the input source should be enumerated, with no duplication that was not already in the input, unless specifically required by the particular partitioner's design. If this is not followed, the output ordering may be scrambled.
- If KeysOrderedInEachPartition returns true, each partition must return elements with increasing key indices.
- If KeysOrderedAcrossPartitions returns true, all the keys in partition numbered N must be larger than all the keys in partition numbered N-1.
- If KeysNormalized returns true, all indices must be monotonically increasing from 0, though not necessarily within a single partition.
Inheritance Hierarchy
System..::.Object
System.Collections.Concurrent..::.Partitioner<(Of <(TSource>)>)
System.Collections.Concurrent..::.OrderablePartitioner<(Of <(TSource>)>)
System.Collections.Concurrent..::.Partitioner<(Of <(TSource>)>)
System.Collections.Concurrent..::.OrderablePartitioner<(Of <(TSource>)>)